#include <iostream>
#include <string>
using namespace std;
int n, l, r;
string s;
 
// 找出字符种类在 [1, x] 之间的⼦串的个数
long long find(int x) 
{
    if(x == 0)
        return 0;
    int left = 0, right = 0; // 滑动窗⼝
    int hash[26] = { 0 }, kinds = 0; // 统计窗⼝内字符种类的个数
    long long ret = 0;
 
    while(right < n)
    {
        if(hash[s[right] - 'a']++ == 0) kinds++;
        while(kinds > x)
        {
            if(hash[s[left] - 'a']-- == 1) kinds--;
            left++;
        }
        ret += right - left + 1;
        right++;
    }
    return ret;
}
 
int main()
{
    cin >> n >> l >> r >> s;
    cout << find(r) - find(l - 1) << endl;
    return 0;
}